{extend name="platform/base" /} {block name="main"}
<!-- 
<div class="row padder-v">
</div> 
-->

<section class="panel panel-default">
	<div class="table-responsive">
		<table class="table table-striped b-light text-sm">
			<thead>
				<tr>
					<th width="40"><input type="checkbox"></th>
					<th width="300">举报主题</th>
					<th class="center">举报类型</th>
					<th width="150" class="center">操作</th>
				</tr>
			</thead>
			<tbody id="list">
				<tr></tr>
			</tbody>
		</table>
	</div>
	{include file="platform/page" /}
</section>
{/block} {block name="script"}
<script type="text/javascript">	
$(function(){
	LoadingInfo(1);
});
	//加载数据
	function LoadingInfo(pageIndex) {
		var search_text = $("#search_text").val();
		$.ajax({
			type : "post",
			async : true,
			data : {
				"pageIndex" : pageIndex, "search_text" : search_text
			},
			success : function(data) {
				var html = '';
				$("#total_count_num").text(data["total_count"]);
				$("#page_count_num").text(data["page_count"]);
				$("#page_count").val(data["page_count"]);
				$("#pageNumber a").remove();
				
				if (data["data"].length > 0) {
					for (var i = 0; i < data["data"].length; i++) {
						html += '<tr>';
						html += '<td class="center"><input type="checkbox" name="sub" value="'+ data['data'][i]['inform_subject_id']+'"></td>';
						html += '<td>' + data["data"][i]["inform_subject_content"] + '</td>';
						html += '<td class="center">' + data["data"][i]["inform_subject_type_name"] + '</td>';
						html += '<td class="center">';
						//html += '<a href="" ">修改</a>&nbsp;';
						html += '<a href="javascript:void(0);" onclick="delreporttopic(' + data["data"][i]["inform_subject_id"] + ')">删除</a>';
						html += '</td>';
						html += '</tr>';
					}
				} else {
					html += '<tr align="center"><td colspan="6" style="text-align:center;">暂无符合条件的数据记录</td></tr>';
				}
				$("#list").html(html);
				var totalpage = $("#page_count").val();
				if (totalpage == 1) {
					changeClass("all");
				}
				var $html = pagenumShow(jumpNumber,totalpage,{$pageshow})
				$("#pageNumber").append($html);
			}
		});
	}
	
	/* 删除品牌 */
	function delreporttopic(inform_subject_id) {
		$( "#dialog" ).dialog({
            buttons: {
                "确定": function() {
                    $(this).dialog('close');
					$.ajax({
						type : "post",
						url : "{:__URL('PLATFORM_MAIN/report/delreporttopic')}",
						data : {
							'inform_subject_id' : inform_subject_id
						},
						async : true,
						success : function(data) {
							if (data['code'] > 0) {
								showMessage('success', data["message"],'{:__URL("PLATFORM_MAIN/report/reporttopiclist")}');
							}else{
								showMessage('error', data["message"]);
							}
						}
					});
                },
                "取消,#e57373": function() {
                    $(this).dialog('close');
                }
            },
            contentText:"你确定删除吗？",
            title:"消息提醒"
        });
	}	
	

</script>
{/block}
